import pandas as pd

# 一、DataFrame数据结构
# DataFrame是由一组数据与一对索引（行索引和列索引）组成的表格型数据结构。
# 1）一列
data_frame_1 = pd.DataFrame(['a', 'b', 'c', 'd'])
print(f'data_frame_1:\n{data_frame_1} , type:', type(data_frame_1))

# 2）多列
data_frame_2 = pd.DataFrame([['a', 'I', 'one'], ['b', 'II', 'two'], ['c', 'III', 'three'], ['d', 'IV', 'four']])
print(f'data_frame_2:\n{data_frame_2} , type:', type(data_frame_2))

# 3）多列+行列
data_frame_3 = pd.DataFrame([['a', 'I', 'one'], ['b', 'II', 'two'], ['c', 'III', 'three'], ['d', 'IV', 'four']],
                            columns=['一列', '二列', '三列'],
                            index=['一行', '二行', '三行', '四行'])
print(f'data_frame_3:\n{data_frame_3} , type:', type(data_frame_3))
print(f'data_frame_3.columns:\n{data_frame_3.columns} ')
print(f'data_frame_3.index:\n{data_frame_3.index} ')
